<?php
// app/views/app.php
class AppView extends View {
    public $helpers = array();
	
    public function __construct(&$controller, $register = true) {
        $globalHelpers = $this->helpers;
        parent::__construct($controller, $register);
        $this->loadHelpers(array_merge($this->helpers, $globalHelpers));
    }
	
    public function loadHelpers($helperNames) {
        $helpers = $this->_loadHelpers($this->loaded, $helperNames);

        foreach ($helpers as $helper) {
            $name = str_replace('Helper', '', get_class($helper));
            $this->$name = $helper;
        }
    }
}
?>